package com.peng.community;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import java.util.Arrays;
import java.util.Comparator;

@SpringBootApplication
public class CommunityApplication {

    @PostConstruct
    public void init() {
        //解决netty冲突问题
        //es启动时，会自动检查processor是否已经启动，若已经启动，抛出异常
        //由于redis底层基于netty，会首先启动导致此问题
        System.setProperty("es.set.netty.runtime.available.processors", "false");
    }

    public static void main(String[] args) {
        SpringApplication.run(CommunityApplication.class, args);
    }

    //print(listOf() quickSort()) bobbleSort()

    public void com(int[] nums) {
//        Arrays.sort(nums, (Comparator<int[]>) (o1, o2) -> o1 - o2);
//        Arrays.sort(nums, new Comparator<Integer>() {
//            @Override
//            public int compare(Integer o1, Integer o2) {
//                return 0;
//            }
//        });
    }
}
